<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>智慧社区管理系统-首页</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
    <style>
        .welcome-container {
            max-width: 600px;
            margin: 80px auto 0 auto;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(52,152,219,0.08);
            padding: 40px 30px 30px 30px;
            text-align: center;
        }
        .welcome-title {
            font-size: 2.2rem;
            font-weight: 700;
            color: #3498db;
            margin-bottom: 18px;
        }
        .welcome-user {
            font-size: 1.3rem;
            color: #2c3e50;
            margin-bottom: 30px;
        }
        .welcome-desc {
            font-size: 1.1rem;
            color: #666;
            margin-bottom: 20px;
        }
        .welcome-logo {
            width: 80px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="welcome-container">
            <img src="../images/default_avatar.png" class="welcome-logo" alt="logo" id="avatar">
            <div class="welcome-title">欢迎使用智慧社区管理系统</div>
            <div class="welcome-user" id="welcomeUser">您好，<span id="username">用户</span>！</div>
            <div class="welcome-desc">
                本系统为社区居民、物业、管理人员提供一站式服务平台，<br>
                支持用户管理、房产管理、费用缴纳、投诉报修、健康预约、商城购物等多种功能。<br>
                祝您生活愉快，工作顺利！
            </div>
        </div>
    </div>
</div>
<script src="../lib/layui-v2.6.3/layui.js"></script>
<script>
    layui.use(['jquery'], function(){
        var $ = layui.jquery;
        // 获取本地存储的用户信息
        const userStr = localStorage.getItem('user');
        // 转换为 JS 对象
        const user = JSON.parse(userStr);
        console.log("user:", user);
        const username = user.user.username;
        $('#username').text(username);
        $('#avatar').srcset(user.user.avatar);
    });
</script>
</body>
</html> 